The present invention relates to a method of appending a dataset onto a dataset already written to a tape medium, and an apparatus such as a magnetic tape device (also referred to as a tape drive below) or portion thereof employing the method.
A large tape drive, such as IBM TS1120, and a tape drive compliant with linear tape open (LTO) sequentially write data to a tape medium in fixed length units called datasets (DS). In response to a reading instruction issued by a host, the tape drive sequentially reads DSs written to the tape. In a tape drive, a tape cartridge is repeatedly used by appending a new DS onto an old DS, instead of deleting the DS written to the tape medium.
FIG. 1 shows a state in which multiple DSs are sequentially written to a tape medium. To “append” a new DS onto a DS already recorded to a tape refers to overwriting the DS recorded to a tape by the new DS. First of all, a tape drive sequentially writes data in DS units to the tape medium while sequentially assigning DS numbers (DS #) to the pieces of data. In the case of appending a DS onto a DS recorded to a tape, it is preferable that the old DS be left on the tape medium and a new DS having the same DS # as the old DS is substantially overwritten thereon.
The lower view in FIG. 1 shows a state in which DSs #1 to #5 are appended. Two types of identification marks including the DS # and a so-called write pass (WP) are assigned to each DS written to the tape. As for writing data, every time the tape drive writes a DS to the tape, the tape drive increments the DS # by one. The WP of each DS indicates the number of times of writing operations. Here, the number of times is increased every time a retry is executed at the occurrence of a write error. When failing to write a DS of DS #X (X being an arbitrary number), the tape drive assigns, to the following DS, a value obtained by increasing the WP, as the WP therefor.
The upper view in FIG. 1 shows a current state of the tape in which each DS is successfully written to the tape, in the initial stage. In the current state, each DS is written only once, and thus the same value (WP 1) is assigned to each of the DSs. In the lower view in FIG. 1, for differentiation, the DSs #1 to #5 used to be appended onto the original DSs #1 to #5 are each assigned a WP 2 obtained by incrementing the WP 1 of each of the original DSs #1 to #5. By using the WP, the tape drive distinguishes a new DS from an old DS among the DSs having the same DS #, appended on a tape, and thus reads the new DS.
For the sake of data integrity (DI), it is preferable that an old DS be completely overwritten by a new DS of the same DS # at the appending operation. However, part of the front and rear ends of an old DS written to a tape remains thereon, due to occurrence of a slight error in writing control of the tape drive. Accordingly, multiple appending operations result in multiple DSs of the same DS # remaining on the tape. When sequentially reading multiple DSs of the same DS #, the tape drive forwards the DS assigned the maximum WP as the newest DS to the host, and assures data integrity (DI).
FIG. 2 illustrates a retry of writing a DS in a position shifted in the tape movement direction (forward), from a position on the tape where an error has occurred in writing an initial DS. Assume a case where there is a scratch, dust or the like on the tape. Here, it is difficult to continuously write DSs on this point of the tape medium by minimizing the spaces between the DSs and giving preference to data recording density. The LTO standards allow the writing position to be shifted for a maximum of 4 m, for instance, to carry out a retry (refer to Ultrium Generation 3 16-Channel Format Specification Document U-316, Revision B, Sep. 7, 2004, which is hereinafter referred to as Non-patent document 1). Here, a WP is incremented for each retry operation. Conventional tape drives employ the technique of carrying out a retry in writing, when an error occurs in writing data to a tape (see Japanese Patent Application Publication No. Hei 8-45200 and U.S. Pat. No. 3,436,206).
By applying the technique of carrying out a retry with position shifting to perform appending, localized dust attachment and scratches due to deterioration with age can be avoided. Hence, permanent errors can be reduced. In the case where an error occurs in appending a DS onto a DS originally recorded to a tape, the appending is retried in a position shifted forward from the position of the original DS. This appending operation is referred to as suspended appending (see Non-patent Document 1). In order to retain existing data while assuring to append a DS onto a DS of the DS # to be changed in one tape cartridge only, it is preferable that the number of permanent errors be reduced at the time of appending. This is because frequent occurrences of permanent errors in appending require needless exchange of tape cartridges and work of backup copy operation for the data (cost and time).
However, assume a case of carrying out a retry by shifting a long distance, that is, to shift from a position of the original DS while jumping over succeeding multiple DSs. Here, in order to assure DI, time is required to identify an old DS from a new DS positioned ahead, having the same DS #. In order to assure DI, a sequential access device (tape drive) is required to first read an old DS of the same DS # and a DS of a succeeding DS #, and then to read an appended DS to identify the newest DS by the WP. Thus, the reading performance of the device is affected.
In the coming years, tape drives may be required to carry out suspended appending in which a dataset is appended onto an existing dataset by shifting the writing position from the position where an error has occurred. Accordingly, it would be desirable to have a method and system for retrying appending so that the reading performance of the device would not be largely influenced even if a DS that was subjected to suspended appending is included.